﻿<%@ Page Language="C#" MasterPageFile="../main.master" Inherits="VioletDevelopmentLaboratory.Net.Web.Configuration.VWebConfigManagerPage" %>
<%@ Import Namespace="System.Web.Configuration" %>

<script runat="server">
	protected void Globalization_DataBind()
	{
		foreach (object data in GlobalizationDataSource.Select())
		{
			GlobalizationSection section = (GlobalizationSection)data;

			CultureTextBox.Text = section.Culture;
			UICultureTextBox.Text = section.UICulture;
			RequestEncodingTextBox.Text = section.RequestEncoding.BodyName;
			ResponseEncodingTextBox.Text = section.ResponseEncoding.BodyName;
			ResponseHeaderEncodingTextBox.Text = section.ResponseHeaderEncoding.BodyName;
			FileEncodingTextBox.Text = section.FileEncoding.BodyName;
			EnableBestFitResponseEncodingCheckBox.Checked = section.EnableBestFitResponseEncoding;
			EnableClientBasedCultureCheckBox.Checked = section.EnableClientBasedCulture;
			ResourceProviderFactoryTypeTextBox.Text = section.ResourceProviderFactoryType;
		}
	}
	protected void GlobalizationDataSource_Updating(object sender, ObjectDataSourceMethodEventArgs e)
	{
		e.InputParameters["culture"] = CultureTextBox.Text;
		e.InputParameters["uiCulture"] = UICultureTextBox.Text;
		e.InputParameters["requestEncoding"] = Encoding.GetEncoding(RequestEncodingTextBox.Text);
		e.InputParameters["responseHeaderEncoding"] = Encoding.GetEncoding(ResponseHeaderEncodingTextBox.Text);
		e.InputParameters["responseEncoding"] = Encoding.GetEncoding(ResponseEncodingTextBox.Text);
		e.InputParameters["fileEncoding"] = Encoding.GetEncoding(FileEncodingTextBox.Text);
		e.InputParameters["enableBestFitResponseEncoding"] = EnableBestFitResponseEncodingCheckBox.Checked;
		e.InputParameters["enableClientBasedCulture"] = EnableClientBasedCultureCheckBox.Checked;
		e.InputParameters["resourceProviderFactoryType"] = ResourceProviderFactoryTypeTextBox.Text;
	}
	protected void GlobalizationDataSource_Updated(object sender, ObjectDataSourceStatusEventArgs e)
	{
		if (e.Exception != null)
		{
			e.ExceptionHandled = true;
			ShowExceptionAlert(e.Exception);
			return;
		}

		ShowAlert("Result", "Success");
	}

	
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!Page.IsPostBack)
		{
			Globalization_DataBind();
		}
	}

	protected void SubmitButton_Click(object sender, EventArgs e)
	{
		GlobalizationDataSource.Update();
	}
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">

	<h2>Globalization</h2>

	<div>
		<asp:ObjectDataSource ID="GlobalizationDataSource" runat="server" 
			SelectMethod="GetGlobalization" 
			TypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.GlobalizationSectionManager" 
			UpdateMethod="Modify" onupdated="GlobalizationDataSource_Updated" 
			onupdating="GlobalizationDataSource_Updating">
			<UpdateParameters>
				<asp:Parameter Name="culture" Type="String" />
				<asp:Parameter Name="uiCulture" Type="String" />
				<asp:Parameter Name="requestEncoding" Type="Object" />
				<asp:Parameter Name="responseHeaderEncoding" Type="Object" />
				<asp:Parameter Name="responseEncoding" Type="Object" />
				<asp:Parameter Name="fileEncoding" Type="Object" />
				<asp:Parameter Name="enableBestFitResponseEncoding" Type="Boolean" />
				<asp:Parameter Name="enableClientBasedCulture" Type="Boolean" />
				<asp:Parameter Name="resourceProviderFactoryType" Type="String" />
			</UpdateParameters>
		</asp:ObjectDataSource>
		<fieldset>
			<table cellspacing="0" cellpadding="5" rules="all" border="1" style="border-collapse:collapse;">
				<tr>
					<td>Culture</td>
					<td>
						<asp:TextBox ID="CultureTextBox" runat="server"></asp:TextBox>
								</td>
				</tr>
				<tr>
					<td>UICulture</td>
					<td>
						<asp:TextBox ID="UICultureTextBox" runat="server"></asp:TextBox>
								</td>
				</tr>
				<tr>
					<td>RequestEncoding</td>
					<td>
						<asp:TextBox ID="RequestEncodingTextBox" runat="server"></asp:TextBox>
								</td>
				</tr>
				<tr>
					<td>ResponseEncoding</td>
					<td>
						<asp:TextBox ID="ResponseEncodingTextBox" runat="server"></asp:TextBox>
								</td>
				</tr>
				<tr>
					<td>ResponseHeaderEncoding</td>
					<td>
						<asp:TextBox ID="ResponseHeaderEncodingTextBox" runat="server"></asp:TextBox>
								</td>
				</tr>
				<tr>
					<td>FileEncoding</td>
					<td>
						<asp:TextBox ID="FileEncodingTextBox" runat="server"></asp:TextBox>
								</td>
				</tr>
				<tr>
					<td>EnableBestFitResponseEncoding</td>
					<td>
						<asp:CheckBox ID="EnableBestFitResponseEncodingCheckBox" runat="server" />
								</td>
				</tr>
				<tr>
					<td>EnableClientBasedCulture</td>
					<td>
						<asp:CheckBox ID="EnableClientBasedCultureCheckBox" runat="server" />
								</td>
				</tr>
				<tr>
					<td>ResourceProviderFactoryType</td>
					<td>
						<asp:TextBox ID="ResourceProviderFactoryTypeTextBox" runat="server"></asp:TextBox>
								</td>
				</tr>
				<tr>
					<td colspan="2">
						<asp:Button ID="SubmitButton" runat="server" Text="업데이트" 
							onclick="SubmitButton_Click" />
					</td>
				</tr>
			</table>
		</fieldset>
	</div>

	<div style="float : left; margin-right : 10px;">
		<table cellspacing="0" cellpadding="3" border="1" width="300">
			<tr>
				<td><strong>
					Culture
				</strong></td>
				<td><strong>
						Language-Location
				</strong></td>
			</tr><tr style="background-color: #ffcc33">
				<td>
					auto
				</td>
				<td>
					auto
				</td>
			</tr><tr style="background-color: #ffcc33">
				<td>
					""(빈 문자열) 
				</td>
				<td>
					고정 culture 
				</td>
			</tr><tr style="background-color: #ffcc33">
				<td>
					ko-KR 
				</td>
				<td>
					한국어 - 한국 
				</td>
			</tr><tr>
				<td>
					zh-HK 
				</td>
				<td>
					중국어 - 홍콩 특별 행정구 
				</td>
			</tr><tr>
				<td>
					zh-MO 
				</td>
				<td>
					중국어 - 마카오 특별 행정구 
				</td>
			</tr><tr>
				<td>
					zh-CN 
				</td>
				<td>
					중국어 - 중국 
				</td>
			</tr><tr>
				<td>
					zh-CHS 
				</td>
				<td>
					중국어(간체) 
				</td>
			</tr><tr>
				<td>
					zh-SG 
				</td>
				<td>
					중국어 - 싱가포르 
				</td>
			</tr><tr>
				<td>
					zh-TW 
				</td>
				<td>
					중국어 - 대만 
				</td>
			</tr><tr>
				<td>
					zh-CHT 
				</td>
				<td>
					중국어(번체) 
				</td>
			</tr><tr>
				<td>
					en 
				</td>
				<td>
					영어 
				</td>
			</tr><tr>
				<td>
					en-AU 
				</td>
				<td>
					영어 - 오스트레일리아 
				</td>
			</tr><tr>
				<td>
					en-BZ 
				</td>
				<td>
					영어 - 벨리즈 
				</td>
			</tr><tr>
				<td>
					en-CA 
				</td>
				<td>
					영어 - 캐나다 
				</td>
			</tr><tr>
				<td>
					en-CB 
				</td>
				<td>
					영어 - 카리브 해 
				</td>
			</tr><tr>
				<td>
					en-IE 
				</td>
				<td>
					영어 - 아일랜드 
				</td>
			</tr><tr>
				<td>
					en-JM 
				</td>
				<td>
					영어 - 자메이카 
				</td>
			</tr><tr>
				<td>
					en-NZ 
				</td>
				<td>
					영어 - 뉴질랜드 
				</td>
			</tr><tr>
				<td>
					en-PH 
				</td>
				<td>
					영어 - 필리핀 
				</td>
			</tr><tr>
				<td>
					en-ZA 
				</td>
				<td>
					영어 - 남아프리카 공화국 
				</td>
			</tr><tr>
				<td>
					en-TT 
				</td>
				<td>
					영어 - 트리니다드 토바고 
				</td>
			</tr><tr>
				<td>
					en-GB 
				</td>
				<td>
					영어 - 영국 
				</td>
			</tr><tr>
				<td>
					en-US 
				</td>
				<td>
					영어 - 미국 
				</td>
			</tr><tr>
				<td>
					en-ZW 
				</td>
				<td>
					영어 - 짐바브웨 
				</td>
			</tr><tr>
				<td>
					ja 
				</td>
				<td>
					일본어 
				</td>
			</tr><tr>
				<td>
					ja-JP 
				</td>
				<td>
					일본어 - 일본 
				</td>
			</tr><tr>
				<td>
					ko 
				</td>
				<td>
					한국어 
				</td>
			</tr>
		</table>
	</div>

	<div style="float : left;">
		<table cellspacing="0" cellpadding="3" border="1" width="400">
			<tr>
				<td><strong>Encoding BodyName</strong></td>
				<td><strong>Encoding Name</strong></td>
			</tr>
			<tr style="background-color: #ffcc33">
				<td>
					utf-8 
				</td>
				<td>
					유니코드(UTF-8) 
				</td>
			</tr>
			<tr style="background-color: #ffcc33">
				<td>ks_c_5601-1987</td>
				<td>한국어</td>
			</tr>
			<tr style="background-color: #ffcc33">
				<td>
					euc-kr 
				</td>
				<td>
					한국어(EUC) 
				</td>
			</tr>
			<tr>
				<td>shift_jis</td>
				<td>일본어(Shift-JIS)</td>
			</tr>
			<tr>
				<td>gb2312</td>
				<td>중국어 간체(GB2312)</td>
			</tr>
			<tr>
				<td>big5</td>
				<td>중국어 번체(Big5)</td>
			</tr>
			<tr>
				<td>utf-16</td>
				<td>유니코드</td>
			</tr>
			<tr>
				<td>unicodeFFFE</td>
				<td>유니코드(Big-Endian)</td>
			</tr>
			<tr>
				<td>windows-1250</td>
				<td>중앙 유럽어(Windows)</td>
			</tr>
			<tr>
				<td>Windows -1252</td>
				<td>서유럽어(Windows)</td>
			</tr>
			<tr>
				<td>x-Chinese-CNS</td>
				<td>중국어 번체(CNS)</td>
			</tr>
			<tr>
				<td>x-cp20001</td>
				<td>TCA 대만</td>
			</tr>
			<tr>
				<td>x-Chinese-Eten</td>
				<td>중국어 번체(Eten)</td>
			</tr>
			<tr>
				<td>
					EUC-JP 
				</td>
				<td>
					일본어(JIS 0208-1990 및 0212-1990) 
				</td>
			</tr>
			<tr>
				<td>
					x-cp20936 
				</td>
				<td>
					중국어 간체(GB2312-80) 
				</td>
			</tr>
			<tr>
				<td>
					x-cp20949 
				</td>
				<td>
					한국어(완성) 
				</td>
			</tr>
			<tr>
				<td>iso-8859-1</td>
				<td>서유럽어(ISO)</td>
			</tr><tr>
				<td>
					iso-8859-2 
				</td>
				<td>
					중앙 유럽어(ISO) 
				</td>
			</tr><tr>
				<td>
					iso-2022-jp 
				</td>
				<td>
					일본어(JIS) 
				</td>
			</tr><tr>
				<td>
					csISO2022JP 
				</td>
				<td>
					일본어(JIS-Allow 1 byte Kana) 
				</td>
			</tr><tr>
				<td>
					iso-2022-jp 
				</td>
				<td>
					일본어(JIS-Allow 1 byte Kana - SO/SI) 
				</td>
			</tr><tr>
				<td>
					iso-2022-kr 
				</td>
				<td>
					한국어(ISO) 
				</td>
			</tr><tr>
				<td>
					x-cp50227 
				</td>
				<td>
					중국어 간체(ISO-2022) 
				</td>
			</tr><tr>
				<td>
					euc-jp 
				</td>
				<td>
					일본어(EUC) 
				</td>
			</tr><tr>
				<td>
					EUC-CN 
				</td>
				<td>
					중국어 간체(EUC) 
				</td>
			</tr>
			<tr>
				<td>
					hz-gb-2312 
				</td>
				<td>
					중국어 간체(HZ) 
				</td>
			</tr><tr>
				<td>
					GB18030 
				</td>
				<td>
					중국어 간체(GB18030) 
				</td>
			</tr><tr>
				<td>
					utf-7 
				</td>
				<td>
					유니코드(UTF-7) 
				</td>
			</tr><tr>
				<td>
					utf-32 
				</td>
				<td>
					유니코드(UTF-32) 
				</td>
			</tr><tr>
				<td>
					utf-32BE 
				</td>
				<td>
					유니코드(UTF-32 Big-Endian) 
				</td>
			</tr>
		</table>
	</div>

</asp:Content>